<?php
namespace app\repair\validate;
use app\validate\Common;
use think\Validate;
use think\Db;
class Goods extends Common
{
	/*验证规则*/
	protected $rule = [
		'repair_id'			=> 'require|int',
		'goods_id'			=> 'require',
		'goods_name'		=> 'require',
		'number'			=> 'require|int',
		'unit'				=> 'require',
		'selling_price'		=> 'require|regex:float_num',
	];
	/*验证提示信息*/
	protected $message = [
		'repair_id.require'			=> '维修单id不能为空',
		'repair_id.int'				=> '维修单id格式错误',
		'goods_id.require'			=> '商品编码不能为空',
		'goods_name.require'		=> '商品名称不能为空',
		'number.require'			=> '配件数量不能为空',
		'number.int'				=> '配件数量格式错误',
		'unit.require'				=> '商品单位不能为空',
		'selling_price.require'		=> '商品销售价不能为空',
		'selling_price.require'		=> '商品销售价格式错误',
	];
	/*验证场景*/
	protected $scene = [
		'add'	=> ['repair_id','goods_id','goods_name','number','unit','selling_price'],
	];

}